#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.demo.module.foo.service.impl;

import ${package}.common.emum.CommonStatusEnum;
import ${package}.common.utils.SnowFlakeUtil;
import ${package}.demo.bean.po.Foo;
import ${package}.demo.bean.vo.FooVo;
import ${package}.demo.bean.vo.UpdateFooVo;
import ${package}.demo.module.foo.mapper.FooMapper;
import ${package}.demo.module.foo.service.FooService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Description: FooService 实现类
 *
 * @author wenxiaopeng
 * @date 2021/06/23 11:40
 *
 * <pre>
 *              ${copyright}
 *      Copyright (c) 2019. All Rights Reserved.
 * </pre>
 */
@Service
public class FooServiceImpl implements FooService {

	@Resource
	private FooMapper fooMapper;

	/**
	 * Description:
	 * <新增Foo>
	 *
	 * @param name 某必要字段
	 * @return ${package}.demo.bean.vo.FooVo
	 * @author wenxiaopeng
	 * @date 11:53 2021/06/23
	 **/
	@Override
	public FooVo addFoo(String name) {
		// do some check for `name`

		// if valid
		Foo foo = new Foo(SnowFlakeUtil.getID(), name, CommonStatusEnum.STATUS_VALID.getCode());
		fooMapper.addFoo(foo);
		return foo.asVo();
	}

	/**
	 * Description:
	 * <更新Foo>
	 *
	 * @param updateFooVo 1
	 * @author wenxiaopeng
	 * @date 11:40 2021/06/23
	 **/
	@Override
	public void updateFoo(UpdateFooVo updateFooVo) {
		fooMapper.updateFoo(updateFooVo);
	}
}
